
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="stripes" uri="http://stripes.sourceforge.net/stripes.tld" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ include file="/support/taglibs.jsp" %>


<stripes:layout-render name="/support/layout/standard.jsp" title="Edit/Add Collaboration">
<stripes:layout-component name="contents">
<stripes:errors/>
<jsp:useBean id="isernManager" scope="page"
           class="edu.hawaii.myisern.model.IsernManager"/>
           
<stripes:form action="/CollaborationForm.action" id="MyForm">

 <table class="leftRightForm">
                <tr>
                    <th>ID:</th>
                    <td>${empty actionBean.id ? "n/a" : actionBean.id}
                        <stripes:hidden name="id"/>
                    </td>
                 </tr>
                 <tr>
                    <th>Name:</th>
                    <td><stripes:text name="collaboration.name"  />
                    </td>                 
                 </tr>
                 <tr>
                    <th>Description:</th>
                    <td><stripes:textarea  name="collaboration.description"  />
                    </td>                 
                 </tr>
                 <tr>
                    <th>Year:</th>
                    <td><stripes:select name="collaborationYears" multiple="true" style="width: 100px; height:5em;">
                            <stripes:options-collection collection="${isernManager.yearOptions}" />
                        </stripes:select>            
                    </td>                 
                 </tr>
                 <tr>
                    <th>Collaborating<br />Organizations:</th>                 
                    <td>
                        <stripes:select name="collaboratingOrganizations" multiple="true">
                        <stripes:option />
                            <stripes:options-collection collection="${isernManager.organizations}"
                            label="name" value="name" />
                        </stripes:select>
                    </td>                            
                 <tr>
                 </tr>                 
                    <th>Outcome Types:</th>     
                    <td>                    
                    <c:forEach  begin="0" end="4" var="i" >            
                       <stripes:text name="outcomeTypes[${i}]" value="${actionBean.collaboration.outcomeTypes.outcomeType[i]}"   /><br>
                    </c:forEach>
                    </td>                      
                 </tr>
                 </tr>                 
                    <th>Collaboartion Types:</th>     
                    <td>
                    <c:forEach  begin="0" end="4" var="i" >            
                       <stripes:text name="collaborationTypes[${i}]" value="${actionBean.collaboration.collaborationTypes.collaborationType[i]}"   /><br>
                    </c:forEach>
                    </td>  
                 </tr>                                             
            </table>
            
            <div class="buttons">
                <stripes:submit name="save" value="Save"/>
            </div>
           </stripes:form>
    </stripes:layout-component>
</stripes:layout-render>
